<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>单号查询</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=yes" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
    <style type="text/css">
        body{background-color: #f2f2f2;}
        .content{width: 100%;}
        .m-top{margin-top:40px;}
        .content-1{margin:50px auto 0;width:90%;}
        .content-2{margin:10px auto 0;width:90%;}
        .input-1{width:60px;height:25px;}
    </style>
</head>
<body>
<div class="viewport">
   <div class="header">
        <div class="header-1">
            <a href="<%=basepath%>3g/mine/mine.jsp" id="join" class="header-2">
                <img src="<%=basepath%>images/tou.png" id="img" class="img"><span id="account" class="account">你还未登录账号哦！</span>
            </a>
            <a href="<%=basepath%>3g/login.jsp" id="logRegister" class="header-3">登 录</a>
        </div>
    </div>
   <div class="content m-top">
       <div class="content-1">
          <span>请输入单号：</span><input type="text" class="input" id="dan" onkeyup='this.value=this.value.replace(/\D/gi,"")'>
       </div>
       <div class="content-2">
          <input type="button" class="input-1" value="查询" id="button">
       </div>
   </div>
</div>
</body>
<script type="text/javascript">
    /*查询*/
    $(function(){
    	$("#button").click(function(){
    		var dan = $("#dan").val();
    		if(dan == ""){
    			layer.msg("请输入单号",{shadeClose:true,shade:0.1,time:2000});
    		}
    		else{
    			window.location.href="http://order.accecard.com/order/"+dan+".html";
    		}
    	});
    });
    /*返回顶部 */
    $(function(){
        $("#top").click(function(){
            $("html,body").animate({scrollTop:0},"slow")
        })
    });
    /*下载*/
    $(function(){
        $(".ios").click(function(){
            layer.msg("敬请期待",{shadeClose:true,shade:0.1,time:2000})
        })
    });
    var ua = navigator.userAgent;
    var isWeixin =  !!/MicroMessenger/i.test(ua);
    function weixinTip(ele){
        var ua = navigator.userAgent;
        var isWeixin = !!/MicroMessenger/i.test(ua);
        if(isWeixin){
            ele.onclick=function(e){
                window.event? window.event.returnValue = false : e.preventDefault();
                document.getElementById('JweixinTip').style.display='block';
            };
            document.getElementById('JweixinTip').onclick=function(){
                this.style.display='none';
            }
        }
    }
    var btn1 = document.getElementById('JdownApp');
    weixinTip(btn1);
    /*登录状态  */
    $(function(){
    	var a = "${sessionScope.user.atUserId}";
    	var b = "${sessionScope.user.companyName}";
    	var c = "${sessionScope.user.thumbnail}";
    	var d = "${sessionScope.user.realName}";
        if(a != ""){
        	$("#purchase").attr("href","/wape-web/api/core/centerService?serviceCode=3002P02");
        	$("#inquiry").attr("href","/wape-web/api/core/centerService?serviceCode=3004P03");
        	$("#audit").attr("href","/wape-web/api/core/centerService?serviceCode=3005P04");
        }
        else if(a == ""){
        	$("#purchase").click(function(){
        		layer.msg("请先登录！",{shadeClose:true,shade:0.1,time:2000});
        	});
        	$("#inquiry").click(function(){
        		layer.msg("请先登录！",{shadeClose:true,shade:0.1,time:2000});
        	});
        	$("#audit").click(function(){
        		layer.msg("请先登录！",{shadeClose:true,shade:0.1,time:2000});
        	});
        }
        if(c != ""){
        	$("#img").attr("src",c);
        }
        if(d != "" ){
        	$("#account").text(d);
            $("#logRegister").attr("href","javascript:void(0)");
            $("#logRegister").text("注 销");
            $("#logRegister").click(function(){
                layer.confirm('确定注销？',{icon:3,title:'注销'},function(index){
                    $.ajax({
                        type:"post",
                        url:"/wape-web/api/core/centerService",
                        data:{
                            serviceCode:"5002U02",
                            logout:"true"
                        },
                        success:function(data){
                            var logRegister = eval("("+data+")");
                            if(logRegister.returnCode == "200"){
                                window.location.href='<%=basepath%>index.jsp';
                                layer.close(index);
                            }
                            else{
                                layer.msg("服务器未响应",{shadeClose:true,shade:0.1,time:2000});
                            }
                        }
                    })
                })
            });
           
        }
        else if(d == ""){
        	
        }
    });

</script>
</html>
